﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using agsXMPP;
using agsXMPP.protocol.client;

namespace Lapd
{
    public partial class SendMessage : Form
    {
        private XmppClientConnection xmppClientConnection;

        public SendMessage(XmppClientConnection xmppClientConnection)
        {
            InitializeComponent();

            this.xmppClientConnection = xmppClientConnection;
        }

        private void mnuEnviar_Click(object sender, EventArgs e)
        {
            Message message = new Message();

            message.Type = MessageType.normal;

            message.To = new Jid(txtTo.Text);
            message.Subject = txtSubject.Text;
            message.Body = txtMessage.Text;

            xmppClientConnection.Send(message);

            this.Close();
        }

        private void mitCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}